<?php

defined('SYSPATH') or die('No direct script access.');

class Controller_Index_Pages extends Controller_Base {

    public function before() {
        parent::before();

        //Віджети
        $menu = $this->widget_load('menu');
        $login = $this->widget_load('login');

        $news = Model::factory('news')->last_news();
        $news = View::factory('index/v_news', array('news' => $news));

        //Вивід в шаблон
        $this->template->block_left = array($menu, $login);
        $this->template->block_right = array($news);
    }

    public function action_index() {
        //$search = Widget::load('widgets/search');
        //$this->template->page_title = 'Головна';

//        /$topproducts = Request::factory('widgets/topproducts')->execute();
        $this->template->block_center = array('Сторінки - головна');
    }

    public function action_Payment() {
        $block_center = View::factory('index/v_index', array('about' => 'Про нас:', 'text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce posuere fermentum sem, id lacinia tortor suscipit eu. Proin metus ante, tincidunt non suscipit in, egestas vel velit. Pellentesque nec fermentum est. In at magna in lacus ultricies cursus. Morbi vel lorem enim, eu eleifend felis. Phasellus eu nisi a elit posuere tincidunt sit amet at urna. Nam a dolor sem. Mauris eros turpis, placerat nec rutrum nec, luctus et quam. '));
        $search = Request::factory('widgets/search')->execute();
        //$this->template->page_title = 'Головна';

        $topproducts = Request::factory('widgets/topproducts')->execute();
        $this->template->block_center = array('Сторінки - Способи оплати');
    }

}

